<%@page contentType="text/html;charset=utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>当当图书 – 全球最大的中文网上书店</title>
		<script type="text/javascript" src="../js/prototype-1.6.0.3.js"></script>
		<script type="text/javascript" src="../js/jquery-1.7.2.min.js" ></script>
		<script type="text/javascript">
			function flash(){
				var flag = $("#select_order").val();
				if(flag == "time"){
					window.location.href='<s:url action="findBooksByCid" namespace="/book"/>?id=<s:property value="category.categoryid"/>&cid=<s:property value="cid"/>&flag=1';
				}
				if(flag == "price"){
					window.location.href='<s:url action="findBooksByCid" namespace="/book"/>?id=<s:property value="category.categoryid"/>&cid=<s:property value="cid"/>&flag=2';
				}
				if(flag == "sellcount"){
					window.location.href='<s:url action="findBooksByCid" namespace="/book"/>?id=<s:property value="category.categoryid"/>&cid=<s:property value="cid"/>&flag=3';
				}
			}
		</script>
		<link href="../css/book.css" rel="stylesheet" type="text/css" />
		<link href="../css/second.css" rel="stylesheet" type="text/css" />
		<link href="../css/secBook_Show.css" rel="stylesheet" type="text/css" />
		<link href="../css/list.css" rel="stylesheet" type="text/css" />
	</head>
	<body>
		&nbsp;
		<!-- 头部开始 -->
		<%@include file="../common/head.jsp"%>
		<!-- 头部结束 -->
		<div style="width: 962px; margin: auto;">
			<a href="#"><img src="../images/default/book_banner_081203.jpg" border="0" /> </a>
		</div>
		<div class='your_position'>
			您现在的位置:&nbsp;
			<a href='#'>当当图书</a> &gt;&gt;
			<font style='color: #cc3300'><strong>
				<s:property value="category.categoryname"/>
			</strong> 
			</font>
			<s:iterator var="c" value="category.clist">
			<s:if test="#c.categoryid == cid">
				&gt;&gt;
			<font style='color: #cc3300'><strong>
						<s:property value="#c.categoryname"/>	
			</strong> 
			</font>
			</s:if>
				</s:iterator>
		</div>
		<div class="book">
			<!--左栏开始-->
			<div id="left" class="book_left">
				<div id="__fenleiliulan">
					<div class=second_l_border2>
						<h2>
							分类浏览
						</h2>
						<ul>
							<li>
								<div>
								<!-- 已点中 -->
								<s:if test="id == category.categoryid && cid ==null">
									<div class=second_fenlei3>
										&middot;
										全部 &nbsp;(<s:property value="category.categorycount"/>)
									</div>
								</s:if>
								<s:else>
									<div class=second_fenlei>
										&middot;
										<a href='<s:url action="findBooksByCid" namespace="/book"/>?id=<s:property value="category.categoryid"/>&flag=<s:property value="flag"/>'> 全部 &nbsp;(<s:property value="category.categorycount"/>)</a>
									</div>
								</s:else>
								</div>
							</li>
							<div class="clear"></div>
							<!--2级分类开始-->
							<s:iterator var="c" value="category.clist">
								<li>
								<s:if test="id == category.categoryid && cid ==#c.categoryid">
									<div>
									<div class=second_fenlei3>
										&middot;
										<s:property value="#c.categoryname"/> &nbsp;(<s:property value="#c.categorycount"/>)
									</div>
									</div>
								</s:if>
								<s:else>
								<div>
									<div class=second_fenlei>
										&middot;
										<a href='<s:url action="findBooksByCid" namespace="/book"/>?id=<s:property value="category.categoryid"/>&cid=<s:property value="#c.categoryid"/>&flag=<s:property value="flag"/>'><s:property value="#c.categoryname"/> &nbsp;(<s:property value="#c.categorycount"/>)</a>
									</div>
									</div>
								</s:else>
								</li>
						    	<div class="clear"></div>
							</s:iterator>
							<!--2级分类结束-->
							<li>
								<div></div>
							</li>
						</ul>
					</div>
				</div>
			</div>
			<!--左栏结束-->
			<!--中栏开始-->
			<div class="book_center">
				<!--图书列表开始-->
				<div id="divRight" class="list_right">
					<div id="book_list" class="list_r_title">
						<div class="list_r_title_text">
							排序方式
						</div>
						<select onchange='flash()' id='select_order' name='select_order' size='1' class='list_r_title_ml'>
							<s:if test="flag==1">
								<option value="time" selected="selected">
									按上架时间 降序
								</option>
							</s:if>
							<s:else>
								<option value="time">
									按上架时间 降序
								</option>
							</s:else>
							<s:if test="flag==2">
								<option value="price" selected="selected">
								按商品价格 降序
							</option>
							</s:if>
							<s:else>
								<option value="price">
									按商品价格 降序
								</option>
							</s:else>
							<s:if test="flag==3">
								<option value="sellcount" selected="selected">
								按商品销量 降序
								</option>
							</s:if>
							<s:else>
								<option value="sellcount">
								按商品销量 降序
							</option>
							</s:else>                      
						</select>
						<div id="divTopPageNavi" class="list_r_title_text3">
							<!--分页导航开始-->
							<div class='list_r_title_text3a'>
							<s:if test="page.hasProPage">
								<a name="link_page_next" href='<s:url action="findBooksByCid" namespace="/book"/>?page.pageIndex=<s:property value="page.pageIndex-1"/>&id=<s:property value="id"/>&cid=<s:property value="cid"/>&flag=<s:property value="flag"/>'>
								<img src='../images/page_up.gif' /> </a>
							</s:if>
							<s:else>
								<a href="#"><img src='../images/page_up.gif' /> </a>
							</s:else>
							</div>
							<div class='list_r_title_text3b'>
								第<s:property value="page.pageIndex"/>页/共<s:property value="page.totalPages" />页
							</div>
							<div class='list_r_title_text3a'>
							<s:if test="page.hasNexPage">
								<a name="link_page_next" href='<s:url action="findBooksByCid" namespace="/book"/>?page.pageIndex=<s:property value="page.pageIndex+1"/>&id=<s:property value="id"/>&cid=<s:property value="cid"/>&flag=<s:property value="flag"/>'>
								<img src='../images/page_down.gif' /> </a>
							</s:if>
							<s:else>
								<a href="#"><img src='../images/page_down.gif' /></a>
							</s:else>
							</div>
							<!--分页导航结束-->
						</div>
					</div>
					<!--商品条目开始-->
					
					<s:iterator value="blist" var="b">
						<div class="list_r_line"></div>
						<div class="clear"></div>
						<div class="list_r_list">
							<span class="list_r_list_book"><a name="link_prd_img" href='<s:url action="findBookById" namespace="/book"/>?id=<s:property value="#b.p_id"/>'>
								<img src="../productImages/1.jpg" /> </a> </span>
							<h2>
								<a name="link_prd_name" href='#'> <s:property value="#b.p_name" /> </a>
							</h2>
							<h3>
								顾客评分：100
							</h3>
							<h4 class="list_r_list_h4">
								作 者:
								<a href='#' name='作者'> <s:property value="#b.p_author"/> </a>
							</h4>
							<h4>
								出版社：
								<a href='#' name='出版社'> <s:property value="#b.p_publishname"/> </a>
							</h4>
							<h4>
								出版时间：<s:date name="#b.p_publishtime" format="yyyy-MM-dd"/>
							</h4>
							<h5>
								<s:property value="#b.p_bookdisc"/>
							</h5>
							<div class="clear"></div>
							<h6>
								<span class="del">￥<s:property value="#b.p_marketprice"/></span>
								<span class="red">￥<s:property value="#b.p_dangprice"/></span>
								节省：￥<s:property value="#b.savePrice" />
							</h6>
							<span class="list_r_list_button"> 
							<a href='<s:url action="addCart" namespace="/cart"/>?pid=<s:property value="#b.p_id"/>'> 
							<img src='../images/buttom_goumai.gif' /></a>
							<span id="cartinfo"></span>
						</div>
					</s:iterator>
						<!--商品条目结束-->
					<div class="clear"></div>
					<div id="divBottomPageNavi" class="fanye_bottom">
					</div>

				</div>
				<!--图书列表结束-->

			</div>
			<!--中栏结束-->
			<div class="clear"></div>
		</div>

		<!--页尾开始 -->
		<%@include file="../common/foot.jsp"%>
		<!--页尾结束 -->
	</body>
</html>
